import Vue from 'vue'
import VueRouter from 'vue-router'
import goodRoute from "@/views/good/route"

Vue.use(VueRouter)

import errorRoute from "@/views/errorpage/route.js"
import mainRoute from "@/views/main/route.js"
import signinRoute from "@/views/signins/route.js"
import deviceRoute from "@/views/device/route.js"
import filmsRoute from "@/views/films/route.js"

const routes = [{
    path: "/",
    redirect: {
      name: "guide"
    }
  },
  {
    path: "/guide",
    name: "guide",
    component: () => import("@/views/guide/guide.vue")

  },
  {
    path: "/search",
    name: "search",
    component: () => import("@/views/search/search.vue")

  },
  {
    path: "/city",
    name: 'city',
    component: () => import("@/views/city/city.vue")
  },
  ...errorRoute,
  ...mainRoute,
  ...signinRoute,
  ...deviceRoute,
  ...filmsRoute,
  ...goodRoute,
  {
    path: '*',
    redirect: {
      nmae: '404'
    }
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})


export default router
